package cn.edu.scau.cmi.dengshixin.composite.consistent;

public class ConsistentPerson extends OrganizationConsistentComponent {
	
	public ConsistentPerson(String name) {
		this.name = name;
		this.organization = null;
	}
	
	public ConsistentPerson(String name, String organization) {
		this.name = name;
		this.organization = organization;
	}
	
	public void doSomething() {
		System.out.println("\t" + this.name + "为[" + this.organization + "]部门做贡献！");
	}
	
	public boolean addChild(OrganizationConsistentComponent oc) { 
		System.out.print(name + "调用了addChild()方法。");
		return super.addChild(oc); 
	}
	
	public boolean removeChild(OrganizationConsistentComponent oc) { 
		System.out.print(name + "调用了removeChild()方法。");
		return super.removeChild(oc); 
	}
	
}
